Stashing Your Data

With PixieDust, you also have the option to export the data from your Notebook to external sources. The output of the display API includes a toolbar which contains the Download button.


Stash to Cloudant

One export option is to save the data directly into a Cloudant or CouchDB database.

Prerequisites

Collect your database connection information: the database host, user name, and password.

If your Cloudant instance was provisioned in Bluemix you can find the connectivity information in the Service Credentials tab.

Steps

  • From the toolbar in the display output, click the Download button

  • Choose Stash to Cloudant from the dropdown menu

If you get an error that a library is missing, you may need to install the cloudant-spark library.

  • Click the dropdown to see the list of available connections

  • Select an existing connection or add a new connection

    • Click the + plus button to add a new connection
    • Enter your Cloudant database credentials in JSON format

      If you are stashing to CouchDB be sure include the protocol. See the sample credentials format below.

    • Click OK

    • Select the new connection
  • Click Submit

Sample Credentials Format

  • CouchDB

    {
      "name": "local-couchdb-connection",
      "credentials": {
          "username": "couchdbuser",
          "password": "password",
          "protocol": "http",
          "host": "127.0.0.1:5984",
          "port": 5984,
          "url": "http://couchdbuser:password@127.0.0.1:5984"
      }
    }
  • Cloudant

    {
      "name": "remote-cloudant-connection",
      "credentials": {
          "username": "username-bluemix",
          "password": "password",
          "host": "host-bluemix.cloudant.com",
          "port": 443,
          "url": "https://username-bluemix:password@host-bluemix.cloudant.com"
      }
    }

Download as File

Alternatively, you may choose to save the data set to a various file formats (e.g., CSV, JSON, XML, etc.)

Steps

  • From the toolbar in the display output, click the Download button
  • Choose Download as File
  • Choose the desired format
  • Specify the number of records to download
  • Click OK